package cn.edu.bzu.aaa.until;

import cn.edu.bzu.aaa.dao.UserDAO;
import cn.edu.bzu.aaa.model.User;

import java.util.List;

public class TestDatabaseConnection {
    public static void main(String[] args) {
        UserDAO userDAO = new UserDAO();
        List<User> users = userDAO.getAll();

        if (users.isEmpty()) {
            System.out.println("No users found in the database.");
        } else {
            System.out.println("Users in the database:");
            for (User user : users) {
                System.out.println("UserID: " + user.getUserID());
                System.out.println("Username: " + user.getUsername());
                System.out.println("Password: " + user.getPassword());
                System.out.println("RegistrationDate: " + user.getRegistrationDate());
                System.out.println("LastLoginDate: " + user.getLastLoginDate());
                System.out.println("UserType: " + user.getUserType());
                System.out.println("Email: " + user.getEmail());
                System.out.println("Title: " + user.getTitle());
                System.out.println("IsLocked: " + user.isLocked());
                System.out.println("IsRegistrationComplete: " + user.isRegistrationComplete());
                System.out.println("----------------------------------------");
            }
        }
    }
}
